

** merge compustat info with dealscan info and sdc platinum 

local file_path_in "/tochange/"

use "`file_path_in'/Compustat/builderfinq.dta", clear

merge m:1 seller year using "`file_path_in'/lpcbuild4.dta", nogen
replace revolveramt = revolveramt / 1000000
replace termloanamt = termloanamt / 1000000

save "`file_path_in'/financialsq.dta", replace

** issuance of loans 
collapse  termloanamt  revolveramt , by(year)
label var termloanamt "Term Loans"
label var revolveramt "Revolvers"

twoway line termloanamt year if year>=2000 & year<2012, xlabel(2000(2)2011) xtitle("Year") ytitle("Term Loan Issuance $(Mil)") graphregion(color(white)) saving("`file_path_in'/reg output/debt_issue3", replace) 
graph export "`file_path_in'/reg output//debt_issue.eps", replace
graph export "`file_path_in'/reg output//debt_issue.png", replace

